//
//  DemoViewController.swift
//  SchoolNews
//
//  Created by 徐涵菲 on 2018/4/24.
//  Copyright © 2018年 Wangly. All rights reserved.
//

import UIKit

class DemoViewController: BaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        // 设置标题
        title = "第 \(navigationController?.childViewControllers.count ?? 0) 个"
    }

    
    // MARK: - 监听方法
    /// 继续 PUSH 一个新的控制器
    @objc fileprivate func showNext() {
        
        let vc = DemoViewController()
        
        navigationController?.pushViewController(vc, animated: true)
    }
}

extension DemoViewController {
    
    /// 重写父类方法
    override func setupTableView() {
        super.setupTableView()
        // 设置右侧的控制器
        
        navItem.rightBarButtonItem=UIBarButtonItem(title: "下一个", target: self, action: #selector(showNext))

    }
  }

